﻿using System.Threading.Tasks;
using Magicodes.ExporterAndImporter.Excel.AspNetCore;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NP.BPMReportPlatform.GC.Dto;
using Volo.Abp.Application.Dtos;

namespace NP.BPMReportPlatform.GC
{
    /// <summary>
    /// 工程接口
    /// </summary>
    [Authorize]
    [ApiController]
    [Route("api/gc")]
    public class GCController : BPMReportPlatformController
    {
        private readonly IGCAppService _gCAppService;

        public GCController(IGCAppService gCAppService)
        {
            _gCAppService = gCAppService;
        }

        /// <summary>
        /// 小于最低起运量运输申请流程 查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("XYZDQYLSQ/GetAllAsync")]
        public async Task<PagedResultDto<GetXYZDQYLSQOutput>> GetAllAsync([FromBody] GetXYZDQYLSQInput input)
        {
            return await _gCAppService.GetAllAsync(input);
        }

        /// <summary>
        /// 小于最低起运量运输申请流程 导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("XYZDQYLSQ/ExportAsync")]
        public async Task<XlsxFileResult<GetXYZDQYLSQOutput>> ExportAsync([FromBody] GetXYZDQYLSQInput input)
        {
            var rst = await _gCAppService.ExportAsync(input);
            return new XlsxFileResult<GetXYZDQYLSQOutput>(rst, "导出Excel");
        }

        /// <summary>
        /// 加急运输审批流程 查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("JJYSSPNew/GetAllAsync")]
        public async Task<PagedResultDto<GetJJYSSPNewOutput>> GetAllAsync([FromBody] GetJJYSSPNewInput input)
        {
            return await _gCAppService.GetAllAsync(input);
        }

        /// <summary>
        /// 加急运输审批流程 导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("JJYSSPNew/ExportAsync")]
        public async Task<XlsxFileResult<GetJJYSSPNewOutput>> ExportAsync([FromBody] GetJJYSSPNewInput input)
        {
            var rst = await _gCAppService.ExportAsync(input);
            return new XlsxFileResult<GetJJYSSPNewOutput>(rst, "导出Excel");
        }

        /// <summary>
        /// 产品提前备货流程 查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("CPTQBH/GetAllAsync")]
        public async Task<PagedResultDto<GetCPTQBHOutput>> GetAllAsync([FromBody] GetCPTQBHInput input)
        {
            return await _gCAppService.GetAllAsync(input);
        }

        /// <summary>
        /// 产品提前备货流程 导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("CPTQBH/ExportAsync")]
        public async Task<XlsxFileResult<GetCPTQBHOutput>> ExportAsync([FromBody] GetCPTQBHInput input)
        {
            var rst = await _gCAppService.ExportAsync(input);
            return new XlsxFileResult<GetCPTQBHOutput>(rst, "导出Excel");
        }

        /// <summary>
        /// 见单生产查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("JDSC/GetAllAsync")]
        public async Task<PagedResultDto<GetJDSCOutput>> GetAllAsync([FromBody] GetJDSCInput input)
        {
            return await _gCAppService.GetAllAsync(input);
        }

        /// <summary>
        /// 见单生产导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("JDSC/ExportAsync")]
        public async Task<XlsxFileResult<ExportJDSCOutput>> ExportAsync([FromBody] GetJDSCInput input)
        {
            var rst = await _gCAppService.ExportAsync(input);
            return new XlsxFileResult<ExportJDSCOutput>(rst, "导出Excel");
        }

        /// <summary>
        /// 工程取消订单查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("GCCancelOrder/GetAllAsync")]
        public async Task<PagedResultDto<GetGCCancelOrderOutput>> GetAllAsync([FromBody] GetGCCancelOrderInput input)
        {
            return await _gCAppService.GetAllAsync(input);
        }

        /// <summary>
        /// 工程取消订单导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("GCCancelOrder/ExportAsync")]
        public async Task<XlsxFileResult<GetGCCancelOrderOutput>> ExportAsync([FromBody] GetGCCancelOrderInput input)
        {
            var rst = await _gCAppService.ExportAsync(input);
            return new XlsxFileResult<GetGCCancelOrderOutput>(rst, "导出Excel");
        }


        /// <summary>
        /// 加急运输查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("ExpeditedTransport/GetAllAsync")]
        public async Task<PagedResultDto<GetExpeditedTransportOutput>> GetAllAsync(
            [FromBody] GetExpeditedTransportInput input)
        {
            return await _gCAppService.GetAllAsync(input);
        }

        /// <summary>
        /// 加急运输导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("ExpeditedTransport/ExportAsync")]
        public async Task<XlsxFileResult<GetExpeditedTransportOutput>> ExportAsync(
            [FromBody] GetExpeditedTransportInput input)
        {
            var rst = await _gCAppService.ExportAsync(input);
            return new XlsxFileResult<GetExpeditedTransportOutput>(rst, "导出Excel");
        }


        /// <summary>
        /// 秀珀工程项目审批流程 查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("XZGCXMSPLC/GetAllAsync")]
        public async Task<PagedResultDto<GetXZGCXMSPLCHeaderOutPut>> GetAllAsync(
            [FromBody] GetXZGCXMSPLCHeaderInput input)
        {
            return await _gCAppService.GetAllAsync(input);
        }

        /// <summary>
        /// 秀珀工程项目审批流程 导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("XZGCXMSPLC/ExportAsync")]
        public async Task<XlsxFileResult<GetXZGCXMSPLCHeaderOutPut>> ExportAsync(
            [FromBody] GetXZGCXMSPLCHeaderInput input)
        {
            var rst = await _gCAppService.ExportAsync(input);
            return new XlsxFileResult<GetXZGCXMSPLCHeaderOutPut>(rst, "导出Excel");
        }


        /// <summary>
        /// 订单非首选工厂申请 查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("DDFSXGCApply/GetAllAsync")]
        public async Task<PagedResultDto<GetDDFSXGCApplyOutput>> GetAllAsync(
            [FromBody] GetDDFSXGCApplyInput input)
        {
            return await _gCAppService.GetAllAsync(input);
        }


        /// <summary>
        /// 订单非首选工厂申请 导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("DDFSXGCApply/ExportAsync")]
        public async Task<XlsxFileResult<GetDDFSXGCApplyOutput>> ExportAsync(
            [FromBody] GetDDFSXGCApplyInput input)
        {
            var rst = await _gCAppService.ExportAsync(input);
            return new XlsxFileResult<GetDDFSXGCApplyOutput>(rst, "导出Excel");
        }


        /// <summary>
        /// 一体板订单取消变更流程  查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("YTBOrder/GetAllAsync")]
        public async Task<PagedResultDto<GetYTBOrderOutput>> GetAllAsync(
            [FromBody] GetYTBOrderInput input)
        {
            return await _gCAppService.GetAllAsync(input);
        }


        /// <summary>
        /// 一体板订单取消变更流程  导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("YTBOrder/ExportAsync")]
        public async Task<XlsxFileResult<GetYTBOrderOutput>> ExportAsync(
            [FromBody] GetYTBOrderInput input)
        {
            var rst = await _gCAppService.ExportAsync(input);
            return new XlsxFileResult<GetYTBOrderOutput>(rst, "导出Excel");
        }

        /// <summary>
        /// 新工程取消订单  查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("GCQXDD/GetAllAsync")]
        public async Task<PagedResultDto<GetEngineeringBatchCancelOrdersOutput>> GetAllAsync(
            [FromBody] GetEngineeringBatchCancelOrdersInput input)
        {
            return await _gCAppService.GetAllAsync(input);
        }


        /// <summary>
        /// 新工程取消订单  导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("GCQXDD/ExportAsync")]
        public async Task<XlsxFileResult<GetEngineeringBatchCancelOrdersOutput>> ExportAsync(
            [FromBody] GetEngineeringBatchCancelOrdersInput input)
        {
            var rst = await _gCAppService.ExportAsync(input);
            return new XlsxFileResult<GetEngineeringBatchCancelOrdersOutput>(rst, "导出Excel");
        }


        /// <summary>
        /// 一体板加急生产申请流程  查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("YTBJJSCSQ/GetAllAsync")]
        public async Task<PagedResultDto<GetYTBUrgentApplicationOutput>> GetAllAsync(
            [FromBody] GetYTBUrgentApplicationInput input)
        {
            return await _gCAppService.GetAllAsync(input);
        }


        /// <summary>
        /// 一体板加急生产申请流程  导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("YTBJJSCSQ/ExportAsync")]
        public async Task<XlsxFileResult<GetYTBUrgentApplicationOutput>> ExportAsync(
            [FromBody] GetYTBUrgentApplicationInput input)
        {
            var rst = await _gCAppService.ExportAsync(input);
            return new XlsxFileResult<GetYTBUrgentApplicationOutput>(rst, "导出Excel");
        }


        /// <summary>
        /// 一体板产品色号维护申请表  查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("YTBCPSHWHSQB/GetAllAsync")]
        public async Task<PagedResultDto<GetYTBCPSHWHSQBOutput>> GetAllAsync(
            [FromBody] GetYTBCPSHWHSQBInput input)
        {
            return await _gCAppService.GetAllAsync(input);
        }


        /// <summary>
        /// 一体板产品色号维护申请表  导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("YTBCPSHWHSQB/ExportAsync")]
        public async Task<XlsxFileResult<GetYTBCPSHWHSQBOutput>> ExportAsync(
            [FromBody] GetYTBCPSHWHSQBInput input)
        {
            var rst = await _gCAppService.ExportAsync(input);
            return new XlsxFileResult<GetYTBCPSHWHSQBOutput>(rst, "导出Excel");
        }



        /// <summary>
        /// 账期调整流程  查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("AccountPeriodAdjustmentApplication/GetAllAsync")]
        public async Task<PagedResultDto<GetAccountPeriodAdjustmentApplicationOutput>> GetAllAsync(
            [FromBody] GetAccountPeriodAdjustmentApplicationInput input)
        {
            return await _gCAppService.GetAllAsync(input);
        }


        /// <summary>
        /// 账期调整流程  导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("AccountPeriodAdjustmentApplication/ExportAsync")]
        public async Task<XlsxFileResult<GetAccountPeriodAdjustmentApplicationOutput>> ExportAsync(
            [FromBody] GetAccountPeriodAdjustmentApplicationInput input)
        {
            var rst = await _gCAppService.ExportAsync(input);
            return new XlsxFileResult<GetAccountPeriodAdjustmentApplicationOutput>(rst, "导出Excel");
        }

        /// <summary>
        /// 账期调整流程  导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("AccountPeriodAdjustmentApplication/ExportApproverAsync")]
        public async Task<XlsxFileResult<GetAccountPeriodAdjustmentApplicationApproverOutput>> ExportApproverAsync(
            [FromBody] GetAccountPeriodAdjustmentApplicationApproverInput input)
        {
            var rst = await _gCAppService.ExportApproverAsync(input);
            return new XlsxFileResult<GetAccountPeriodAdjustmentApplicationApproverOutput>(rst, "导出Excel");
        }


        /// <summary>
        /// 设计依赖书查看接口
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("DesignDependencyBook/GetAllAsync")]
        public async Task<PagedResultDto<DesignDependencyBookOutput>> GetAllAsync(
            [FromBody] DesignDependencyBookInput input)
        {
            return await _gCAppService.GetAllAsync(input);
        }


        /// <summary>
        /// 设计依赖书查导出接口
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("DesignDependencyBook/ExportAsync")]
        public async Task<XlsxFileResult<DesignDependencyBookOutput>> ExportAsync(
            [FromBody] DesignDependencyBookInput input)
        {
            var rst = await _gCAppService.ExportAsync(input);
            return new XlsxFileResult<DesignDependencyBookOutput>(rst, "导出Excel");
        }
    }
}